<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>意见反馈信息预览</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <script>
        window.onload = function() {
            var pageBottom = document.documentElement.scrollHeight;
            window.scrollTo(0, pageBottom);
        };
    </script>
    <style>
        .wechat-reply {
            display: flex;
        }

        .textarea-wrapper {
            flex: 1;
            margin-right: 10px;
        }

        .button-wrapper {
            width: 80px;
        }

        .wechat-reply textarea {
            height: 60px !important;
            min-height: unset !important;
            resize: none;
            border: 1px solid #ccc;
            outline: none;
            font-size: 14px;
            width: 100%;
            padding: 5px;
            box-sizing: border-box;
        }

        .reply-btn {
            height: 60px;
            width: 100%;
        }
    </style>
</head>
<body>
<div class="layui-col-sm12" id="content1">
    <div class="layui-card">
        <div class="layui-card-body">
            <ul class="layuiadmin-card-status layuiadmin-home2-usernote">
                <li>
                    <h3>用户ID：{$itself.uid}</h3>
                    <p>{$itself.content}</p>
                    <span>{$itself.create_time}</span>
                </li>
                {volist name="faqs" id="v" key="k"}
                {if $v.uid != 0}
                <li>
                    <h3>用户ID：{$v.uid}</h3>
                    <p>{$v.content}</p>
                    <span>{$v.create_time}</span>
                </li>
                {else /}
                <li style="text-align: right;">
                    <p>{$v.content}</p>
                    <span>{$v.create_time}</span>
                </li>
                {/if}
                {/volist}
            </ul>

            <div class="wechat-reply">
                <div class="textarea-wrapper">
                    <textarea name="desc" placeholder="请输入内容" class="layui-textarea" id="content"></textarea>
                </div>
                <div class="button-wrapper">
                    <button class="layui-btn reply-btn" lay-submit lay-filter="formDemo" class="layui-btn layui-btn-xs layuiadmin-reply" onclick="replyNote('{$info.uid}','{$info.id}');">回复</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
        ,version: 1
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index'],function () {
    });

    function replyNote(uid,id){
        var value = layui.$("#content").val();
        layui.admin.req({
            url: '/faq/reply'
            , type: "POST"
            , data: {from_id:id,content:value}
            , done: function (res) {
                layer.msg('回复成功', {icon: 1, time: 1000}, function () {
                    location.reload();
                });
            }, not_finish: function (res) {
                layer.msg(res.msg);
            }
        });
    }
</script>
</body>
</html>